package ui.view;

import org.jfree.ui.tabbedui.VerticalLayout;

import javax.swing.*;
import java.awt.*;

public class LabelTextPanel extends JPanel{
    private JPanel left = new JPanel();
    private JPanel right = new JPanel();
    private int i;
    private GridLayout leftgridLayout = new GridLayout(1,1);
    private GridLayout rightgridLayout = new GridLayout(1,1);
    public LabelTextPanel()
    {

        this.setLayout(new BoxLayout(this,BoxLayout.X_AXIS));
        this.add(left);
        this.add(right);
//        this.setPreferredSize(new Dimension(200,500));
        left.setLayout(leftgridLayout);
        right.setLayout(rightgridLayout);
//        left.setLayout(new VerticalLayout());
//        right.setLayout(new VerticalLayout());
    }
    public void addLabelTextPanel(String label,JTextPane jComponent)
    {
        i++;
        leftgridLayout.setRows(i);
        rightgridLayout.setRows(i);
        left.add(new Label(label));
        right.add(jComponent);
//        this.setPreferredSize(new Dimension(100,i*30));
//        left.add(Box.createHorizontalStrut(10));
//        right.add(Box.createHorizontalStrut(10));
    }
}
